package util ;

/**
 * throw this if you detect a bug.
 * 
 * @author idan
 */
public class Bug extends RuntimeException
{

	private static final String LEFT_BUG_DECORATOR = "bug detected: " ;

	private static final String RIGHT_BUG_DECORATOR = "" ;
	private static final long serialVersionUID = 4006010763572047154L ;

	private static String wrapMessageWithBugNote(final String message)
	{
		return Bug.LEFT_BUG_DECORATOR + message + Bug.RIGHT_BUG_DECORATOR ;
	}

	/**
	 * all we know is that a bug exists.
	 */
	public Bug()
	{
		super() ;
	}

	/**
	 * @param message what is the error?
	 */
	public Bug(final String message)
	{
		super(message) ;
	}

	/**
	 * @param message what is the error?
	 * @param cause why did that happen?
	 */
	public Bug(final String message, final Throwable cause)
	{
		super(Bug.wrapMessageWithBugNote(message), cause) ;
	}

	/**
	 * @param cause why did that happen?
	 */
	public Bug(final Throwable cause)
	{
		super(cause) ;
	}

}
